var routes = [
    new routing.routes.NavigationRoute("pages/p1", "page1.html", { cacheView: true, isDefault: true, vmFactory: function (callback) {
        callback(new viewModels.Page1VM());
    }, title: "Page #1" }),
    new routing.routes.NavigationRoute("pages/p2/{name}/{?value}", "page2.html?name={name}", { cacheView: false, vmFactory: function (callback) {
        callback(new viewModels.Page2VM());
    }, title: "Page #2" }),
    new routing.routes.NavigationRoute("pages/p3", "page3.html", { cacheView: false, vmFactory: function (callback) {
        callback(new viewModels.Page3VM());
    }, title: "Page #3" }),
];
var router = new routing.Router("views-placeholder", // ID of element in which will be loaded views.
    {
        beforeNavigation: function () { },    // Global before navigation handler.
        afterNavigation: function () { },     // Global after navigation handler.
        navigationError: function () {
            router.navigateBack();
        }, // Global navigation error handler.
        enableLogging: true, // Loggin router activity into console output.
        preloadEnabled: true
    },
    routes);        // Routes are described below.
// This is the array of Route objects.
routing.knockout.setCurrentRouter(router);
ko.applyBindings({}); // This requered to allow ko bindings to work ewrywhere on the page.
// You can put here root level view model of application.
router.run(); // Starting of router.